using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using Yunwei.Domain.Models.Mapping;

namespace Yunwei.Domain.Models
{
    public partial class SmartRestaurantContext : DbContext
    {
        static SmartRestaurantContext()
        {
            Database.SetInitializer<SmartRestaurantContext>(null);
        }

        public SmartRestaurantContext()
            : base("Name=SmartRestaurantContext")
        {
        }

        public DbSet<Artical> Articals { get; set; }
        public DbSet<Category> Categories { get; set; }
        public DbSet<Chef> Chefs { get; set; }
        public DbSet<Cuisine> Cuisines { get; set; }
        public DbSet<Food> Foods { get; set; }
        public DbSet<FoodIngredient> FoodIngredients { get; set; }
        public DbSet<Ingredient> Ingredients { get; set; }
        public DbSet<Order> Orders { get; set; }
        public DbSet<OrderFoodRel> OrderFoodRels { get; set; }
        public DbSet<Restaurant> Restaurants { get; set; }
        public DbSet<RestaurantCuisineRel> RestaurantCuisineRels { get; set; }
        public DbSet<RestaurantIngredient> RestaurantIngredientRels { get; set; }
        public DbSet<Role> Roles { get; set; }
        public DbSet<Section> Sections { get; set; }
        public DbSet<Staff> Staffs { get; set; }
        public DbSet<User> Users { get; set; }
        public DbSet<UserRoleRel> UserRoleRels { get; set; }
        public DbSet<Vendor> Vendors { get; set; }
        public DbSet<VendorIngredient> VendorIngredientRels { get; set; }
        public DbSet<Waiter> Waiters { get; set; }
        public DbSet<VendorCustomer> VendorCustomers { get; set; }
        public DbSet<RestaurantVendor> RestaurantVendors { get; set; }
        public DbSet<ShoppingCart> ShoppingCart { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new ArticalMap());
            modelBuilder.Configurations.Add(new CategoryMap());
            modelBuilder.Configurations.Add(new ChefMap());
            modelBuilder.Configurations.Add(new CuisineMap());
            modelBuilder.Configurations.Add(new FoodMap());
            modelBuilder.Configurations.Add(new FoodIngredientMap());
            modelBuilder.Configurations.Add(new IngredientMap());
            modelBuilder.Configurations.Add(new OrderMap());
            modelBuilder.Configurations.Add(new OrderFoodRelMap());
            modelBuilder.Configurations.Add(new RestaurantMap());
            modelBuilder.Configurations.Add(new RestaurantCuisineRelMap());
            modelBuilder.Configurations.Add(new RestaurantIngredientRelMap());
            modelBuilder.Configurations.Add(new RoleMap());
            modelBuilder.Configurations.Add(new SectionMap());
            modelBuilder.Configurations.Add(new StaffMap());
            modelBuilder.Configurations.Add(new UserMap());
            modelBuilder.Configurations.Add(new UserRoleRelMap());
            modelBuilder.Configurations.Add(new VendorMap());
            modelBuilder.Configurations.Add(new VendorIngredientMap());
            modelBuilder.Configurations.Add(new WaiterMap());
            modelBuilder.Configurations.Add(new VendorCustomerMap());
            modelBuilder.Configurations.Add(new ShoppingCartMap());
            //modelBuilder.Configurations.Add(new RestaurantVendorMap());
        }
    }
}
